<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "project_mapping".
 *
 * @property string $id
 * @property string $title_full 项目完整标题
 * @property string $code 项目编号
 * @property int $cid 项目类别
 * @property string $sell_price 售价
 * @property string $thumbnail 列表页缩略图
 * @property string $thumbnail_mobile 移动端列表页缩略图
 * @property int $set_reserve 是否平台保留，1是2否，默认2
 */
class ProjectMappingDjr extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'project_mapping';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('forge');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['cid',], 'required'],
            [['id', 'cid', 'set_reserve'], 'integer'],
            [['title_full', 'code', 'sell_price', 'thumbnail', 'thumbnail_mobile'], 'string', 'max' => 255],
            [['id'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'title_full' => '项目完整标题',
            'code' => '项目编号',
            'cid' => '项目类别',
            'sell_price' => '售价',
            'thumbnail' => '列表页缩略图',
            'thumbnail_mobile' => '移动端列表页缩略图',
            'set_reserve' => '是否平台保留，1是2否，默认2',
        ];
    }

    /**
     * @inheritdoc
     * @return ProjectMappingDjrQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new ProjectMappingDjrQuery(get_called_class());
    }
}
